import { IgetDetailByNoticeSerialNo } from '@/typings/getDetailByNoticeSerialNo';
import { IqueryDictionaries } from '@/typings/queryDictionaries';
import { IqueryBindPatInfo } from '@/typings/queryBindPatInfo';

// eslint-disable-next-line @typescript-eslint/no-namespace
export declare namespace commonTypes {
  export interface Icolumns {
    text?: string | number;
    name?: string | number;
    code?: string | number;
    children?: Icolumns[];
    itemsCode?: string | number;
    itemsName?: string | number;
    [propName: string]: any;
  }
  export interface ICodeName {
    code?: any;
    name?: any;
  }
  interface IpayloadItem {
    keyOne?: string | null;
    keyTwo?: string | null;
    valueAndObj: any;
  }
  export interface IselectProps {
    name: string;
    label: string;
    placeholder?: string;
    position?: string;
    columns?: Icolumns[];
    required?: boolean;
    isLink?: boolean;
    readonly?: boolean;
    handleValue?: () => any; //处理需要绑定的value值
    value?: string;
    keyOne?: string | null;
    keyTwo?: string | null;
    maxlength?: number | string;
    inputType?: string; //是否整数 输入框用
    type?: string; //  下面弹框类型用
    ProvCityCountyArray?: Array<string>; //省市区3个字段赋值才需要的
    validator?: (value?: any, rule?: any) => any; //验证函数用
    errorMessage?: string; //错误提示
    [propName: string]: any;
  }

  //省市区的
  interface ISieDictionaries {
    itemsCode?: string;
    itemsName?: string;
    upperCode?: string;
    text?: string;
    value?: string;
    children?: ISieDictionaries[];
    [propName: string]: any;
  }

  interface IState {
    isConfirm: string;
    form: IgetDetailByNoticeSerialNo.BusObj;
    dictionaries: IqueryDictionaries.IBusObj; //字典
    provCityCounty: commonTypes.ISieDictionaries[]; //接口的省市区字典
    hospitalId: string | number;
    hospitalUUID: string | number;
    provCityCountyColumns: commonTypes.ISieDictionaries[]; //组装后的省市区
    currentUser: IqueryBindPatInfo.IBusObj; //选择的当前用户
  }
}
